/* 
 * File:   QImageLoader.h
 * Author: matt
 *
 * Created on 16 May 2010, 20:29
 */

#ifndef _QIMAGELOADER_H
#define	_QIMAGELOADER_H
#include <QWidget>
#include <QLayout>
#include <QGridLayout>
#include <QPushButton>
#include <QFileDialog>
#include <QImage>
#include <iostream>
#include <string>

using namespace std;

class QImageLoader : public QWidget {
    Q_OBJECT
public:
    QImageLoader();
    virtual ~QImageLoader();

public slots:
    void getImage();

signals:
    void newImage(QImage image);

private slots:
    void openFiles(QStringList selected);
    void showDialog(bool pressed);
    void nextImage(bool pressed);
    void nextImage();
    void prevImage(bool pressed);
    void playImages(bool pressed);
    void loopImages(bool pressed);

private:
    QGridLayout *layout;
    QTimer *timer;
    QFileDialog filedialog;
    QList<QImage> images;
    QPushButton *load_button;
    QPushButton *next_button;
    QPushButton *prev_button;
    QPushButton *loop_button;
    QPushButton *play_button;
    int index;
    bool loop;
    bool play;

};

#endif	/* _QIMAGELOADER_H */

